package model;

import java.util.Scanner;

public class Point {
	private int x;
	private int y;
	
	//constructor
	public Point() {
		x = 0;
		y = 0;
	}
	
	//gettor - x - hoành độ (abscissa)
	public int getX() {
		return x;
	}
	
	//gettor - y - tung độ (ordinate)
	public int getY() {
		return y;
	}
	
	//settor - x (abscissa)
	public void setX(int x2) {
		x = x2;
	}
	
	//settor - y (ordinate)
	public void setY(int y2) {
		y = y2;
	}
	
	public void enterCoOrdinate() {
		Scanner scanner = new Scanner(System.in);
		
		System.out.print("Nhap hoanh do x: ");
		x = scanner.nextInt();
		
		System.out.print("Nhap tung do y: ");
		y = scanner.nextInt();
	}
	
	public void printCoOrdinate() {
		System.out.print("Ban vua nhap diem voi toa do: ");
		System.out.print("\t x = " + x + ",\t y = " + y);
		System.out.println();
	}
	
	public void printPositionPoint() {
		if(x > 0 && y > 0) {
			System.out.println("Diem nay thuoc goc phan tu thu I");
		}
		else if(x < 0 && y > 0) {
			System.out.println("Diem nay thuoc goc phan tu thu II");
		}
		else if(x < 0 && y < 0) {
			System.out.println("Diem nay thuoc goc phan tu thu III");
		}
		else if(x > 0 && y < 0) {
			System.out.println("Diem nay thuoc goc phan tu thu IV");
		}
		else if(x ==0 && y != 0) {
			System.out.println("Diem nay nam tren truc tung");
		}
		else if(x != 0 && y ==0) {
			System.out.println("Diem nay nam tren truc hoanh");
		}
		else {
			System.out.println("Diem nay thuoc goc toa do");
		}
	}

}
